package com.ssy.lingxi.logistics.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.logistics.api.dto.request.CommonIdRequest;
import com.ssy.lingxi.logistics.api.dto.response.LogisticsOrderFeignResponse;
import com.ssy.lingxi.logistics.api.fallback.LogisticsOrderControllerFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @menu 内部服务 - 物流单
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/10
 */
@FeignClient(name = "logistics-service", fallback = LogisticsOrderControllerFeignFallback.class)
public interface LogisticsOrderControllerFeign {

    /**
     * 物流单删除
     * @param request 接口参数
     * @return 返回结果
     */
    @PostMapping(value = "/logistics/order/feign/delete")
    Wrapper<Void> deleteLogisticsOrder(@RequestBody @Validated CommonIdRequest request);

    /**
     * 物流单信息
     * @param id 接口参数
     * @return 返回结果
     */
    @GetMapping(value = "/logistics/order/feign/detail")
    Wrapper<LogisticsOrderFeignResponse> getLogisticsOrder(@RequestParam(name = "id") Long id);

    /**
     * 物流单信息
     * @param ids 接口参数
     * @return 返回结果
     */
    @PostMapping(value = "/logistics/order/feign/list")
    Wrapper<List<LogisticsOrderFeignResponse>> listLogisticsOrder(@RequestBody List<Long> ids);

}